# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
# Contributor: Douglas Soares de Andrade <douglas@archlinux.org>

pkgname=meld
pkgver=3.19.0
pkgrel=3
pkgdesc="Compare files, directories and working copies"
url="http://meldmerge.org/"
license=(GPL)
arch=(any)
depends=(python-gobject python-cairo gtksourceview3 gsettings-desktop-schemas dconf)
makedepends=(intltool itstool git)
_commit=7900d9ab60bb41feef236756c622918e25d1e4ba  # tags/3.19.0^0
source=("git+https://gitlab.gnome.org/GNOME/meld.git#commit=$_commit")
sha1sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname

  # https://gitlab.gnome.org/GNOME/meld/issues/217
  git cherry-pick -n bdf15911
}

build() {
  cd $pkgname
  python setup.py build
}

package() {
  cd $pkgname
  # using --skip-build breaks install
  python setup.py --no-update-icon-cache --no-compile-schemas \
    install --prefix=/usr --root="$pkgdir" --optimize=1
}
